<template>
   <header class="header">
      <h1>todos</h1>
      <!-- <button @click="fnn">qqq</button> -->
      <input class="new-todo" placeholder="请输入任务名称" autofocus @keyup.enter="add" v-model.trim="name"/>
    </header>
</template>

<script>
import { mapActions } from 'vuex';
export default {
  data() {
    return {
      name: '',
      
    }
  },
  props: ['list'],
  methods: {
    ...mapActions('list',['addlist']),
    add() {
      if(!this.name) return
      this.addlist({ isDone: false, title: this.name })
      this.name = ''
    },
    fnn(val) {
      // console.log(this.value);
        console.log(val);
      }
     }
}
</script>

<style>

</style>